import type { RouteRecordRaw } from 'vue-router';
import { $t } from '#/locales';

const routes: RouteRecordRaw[] = [
  {
    meta: {
      icon: 'mdi:book-open-page-variant',
      keepAlive: true,
      order: 900,
      title: $t('fsb.title'),
      authority: ['softwares-api', 'games-api'],
    },
    name: 'FSB',
    path: '/fsb',
    children: [
      {
        meta: {
          title: $t('fsb.softwares.title'),
          icon: 'mdi:apps',
          authority: ['softwares-api'],
        },
        name: 'FSBSoftwares',
        path: '/softwares',
        children: [
          {
            meta: {
              title: $t('fsb.softwares.balance.title'),
              icon: 'mdi:currency-usd',
              authority: ['Balance:GetPage'],
            },
            name: 'FSBSoftwaresBalance',
            path: 'balance',
            component: () => import('#/views/fsb/softwares/balance.vue'),
          },
          {
            meta: {
              title: $t('fsb.softwares.balanceLog.title'),
              icon: 'mdi:currency-usd-off',
              authority: ['BalanceLog:GetPage'],
            },
            name: 'FSBSoftwaresBalanceLog',
            path: 'balance-log',
            component: () => import('#/views/fsb/softwares/balance-log.vue'),
          },
          {
            meta: {
              title: $t('fsb.softwares.function.title'),
              icon: 'mdi:function',
              authority: ['Function:GetPage'],
            },
            name: 'FSBSoftwaresFunction',
            path: 'function',
            component: () => import('#/views/fsb/softwares/function.vue'),
          },
          {
            meta: {
              title: $t('fsb.softwares.functionAuth.title'),
              icon: 'mdi:shield-key',
              authority: ['FunctionAuth:GetPage'],
            },
            name: 'FSBSoftwaresFunctionAuth',
            path: 'function-auth',
            component: () => import('#/views/fsb/softwares/function-auth.vue'),
          },
          {
            meta: {
              title: $t('fsb.softwares.functionAuthLog.title'),
              icon: 'mdi:history',
              authority: ['FunctionAuthLog:GetPage'],
            },
            name: 'FSBSoftwaresFunctionAuthLog',
            path: 'function-auth-log',
            component: () =>
              import('#/views/fsb/softwares/function-auth-log.vue'),
          },
          {
            meta: {
              title: $t('fsb.softwares.qrCodeOrder.title'),
              icon: 'mdi:qrcode',
              authority: ['QrCodeOrder:GetPage'],
            },
            name: 'FSBSoftwaresQrCodeOrder',
            path: 'qrcode-order',
            component: () => import('#/views/fsb/softwares/qrcode-order.vue'),
          },
          {
            meta: {
              title: $t('fsb.softwares.taskPlan.title'),
              icon: 'mdi:calendar-clock',
              authority: ['TaskPlan:GetPage'],
            },
            name: 'FSBSoftwaresTaskPlan',
            path: 'task-plan',
            component: () => import('#/views/fsb/softwares/task-plan.vue'),
          },
          {
            meta: {
              title: $t('fsb.softwares.updateLog.title'),
              icon: 'mdi:update',
              authority: ['UpdateLog:GetPage'],
            },
            name: 'FSBSoftwaresUpdateLog',
            path: 'update-log',
            component: () => import('#/views/fsb/softwares/update-log.vue'),
          },
        ],
      },
      {
        meta: {
          title: $t('fsb.games.title'),
          icon: 'mdi:gamepad-variant',
          authority: ['games-api'],
        },
        name: 'FSBGames',
        path: '/games',
        children: [
          {
            meta: {
              title: $t('fsb.games.memoryAddress.title'),
              icon: 'mdi:memory',
              authority: ['MemoryAddress:GetPage'],
            },
            name: 'FSBGamesMemoryAddress',
            path: 'memory-address',
            component: () => import('#/views/fsb/games/memory-address.vue'),
          },
          {
            meta: {
              title: $t('fsb.games.gameArea.title'),
              icon: 'mdi:map-marker-radius',
              authority: ['GameArea:GetPage'],
            },
            name: 'FSBGamesGameArea',
            path: 'game-area',
            component: () => import('#/views/fsb/games/game-area.vue'),
          },
          {
            meta: {
              title: $t('fsb.games.gameMap.title'),
              icon: 'mdi:map',
              authority: ['GameMap:GetPage'],
            },
            name: 'FSBGamesGameMap',
            path: 'game-map',
            component: () => import('#/views/fsb/games/game-map.vue'),
          },
          {
            meta: {
              title: $t('fsb.games.point.title'),
              icon: 'mdi:crosshairs-gps',
              authority: ['Point:GetPage'],
            },
            name: 'FSBGamesPoint',
            path: 'point',
            component: () => import('#/views/fsb/games/point.vue'),
          },
          {
            meta: {
              title: $t('fsb.games.gameRole.title'),
              icon: 'mdi:account',
              authority: ['GameRole:GetPage'],
            },
            name: 'FSBGamesGameRole',
            path: 'game-role',
            component: () => import('#/views/fsb/games/game-role.vue'),
          },
        ],
      },
    ],
  },
];

export default routes;
